<template>
  <div class="NavigationBar">
    <div class="height"></div>
    <!-- 底部 -->
    <footer>
      <router-link to="/HomeView" tag="a">
        <div class="img"></div>
        <span>首页</span>
      </router-link>
      <router-link to="/CommunityView" tag="a">
        <div class="img"></div>
        <span>社区</span>
      </router-link>
      <router-link to="/FoundView" tag="a">
        <div class="img"></div>
        <span>发现</span>
      </router-link>
      <router-link to="/SpaceView" tag="a">
        <div class="img"></div>
        <span>空间</span>
      </router-link>
    </footer>
  </div>
</template>

<script>
export default {
  data() {
    return {
      NavigationBarIndex: 0,
    };
  },
};
</script>

<style lang="scss" >
.NavigationBar {
  .height {
    height: 54px;
  }
  footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fafafa;
    border-top: 1px solid #e0e0e0;
    height: 54px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    min-width: 320px;
    max-width: 750px;
    margin: auto;
    a {
      display: block;
      width: 27px;
      text-align: center;
      &:nth-child(1) {
        .img {
          background: url(../assets/img/NavigationBar/footer-1.png) no-repeat;
          background-size: cover;
        }
        &.router-link-active {
          .img {
            background-image: url(../assets/img/NavigationBar/footer-11.png);
          }
        }
      }
      &:nth-child(2) {
        .img {
          background: url(../assets/img/NavigationBar/footer-2.png) no-repeat;
          background-size: cover;
        }
        &.router-link-active {
          .img {
            background-image: url(../assets/img/NavigationBar/footer-22.png);
          }
        }
      }
      &:nth-child(3) {
        .img {
          background: url(../assets/img/NavigationBar/footer-3.png) no-repeat;
          background-size: cover;
        }
        &.router-link-active {
          .img {
            background-image: url(../assets/img/NavigationBar/footer-33.png);
          }
        }
      }
      &:nth-child(4) {
        .img {
          background: url(../assets/img/NavigationBar/footer-4.png) no-repeat;
          background-size: cover;
        }
        &.router-link-active {
          .img {
            background-image: url(../assets/img/NavigationBar/footer-44.png);
          }
        }
      }
      &.router-link-active {
        span {
          color: #0cc85c;
        }
      }
      .img {
        width: 27px;
        height: 27px;
      }
      span {
        display: block;
        font-size: 12px;
        height: 20px;
        line-height: 20px;
        color: #323232;
      }
      &.icon {
        position: relative;
        bottom: 8px;
        min-width: max-content;
        .img {
          width: 43px;
          height: 43px;
          margin: 0 auto;
        }
      }
    }
  }
}
</style>